﻿@using NigiriClub.WebUI.Models
@using NigiriClub.WebUI.Utils.PagingHelper
@model NigiriClub.WebUI.Models.PagedCollections.NewswireViewModel

@{
    ViewBag.Title = "Home Page";
}

@if (User.Identity.IsAuthenticated && Account.GetAccount(User.Identity.Name).PermissionId == 2)
{
    @Html.Partial("AddNews", new NigiriClub.WebUI.Models.News())
}

<div name="Newswire">
    @foreach (var news in Model.News)
    {
        @Html.Partial("News", news)
    }
</div>

<div style="text-align: center">
    <ul class="pagination">
        @Html.PageLinks(Model.PageInfo, x => Url.Action("Index",
       new { page = x, tag = ViewBag.Tag, category = ViewBag.Category }))
    </ul>
</div>
